package es.javamyadmin.beans;

import java.io.Serializable;
import java.util.Collection;

import es.javamyadmin.modelo.Databases;
import es.javamyadmin.modelo.ModelFacade;

/**
 * Bean para las Bases de Datos
 * @author Hector Delgado Duran
 * @author Emilio Javier Castillo Gonzalez
 * @version 1.0
 */
public class ListaDatabasesBean implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5279478328703924773L;
	private String user = new String();
	private String pass = new String();
	private String host = new String();
	private String port = new String();
	
	
	/**
	 * Constructor
	 */
	public ListaDatabasesBean() {
		super();
	}


	/**
	 * @return el usuario
	 */
	public String getUser() {
		return user;
	}


	/**
	 * @param user the user to set
	 */
	public void setUser(String user) {
		this.user = user;
	}


	/**
	 * @return the pass
	 */
	public String getPass() {
		return pass;
	}


	/**
	 * @param pass the pass to set
	 */
	public void setPass(String pass) {
		this.pass = pass;
	}


	/**
	 * @return El servidor
	 */
	public String getHost() {
		return host;
	}


	/**
	 * @param Set del servidor
	 */
	public void setHost(String host) {
		this.host = host;
	}


	/**
	 * @return El puerto
	 */
	public String getPort() {
		return port;
	}


	/**
	 * @param Set del puerto
	 */
	public void setPort(String port) {
		this.port = port;
	}


	/**
	 * Metodo que obtiene una lista con las bases de datos
	 * @return lista de bases de datos
	 */
	public Collection<Databases> getDatabases(){
		
		Collection<Databases> databases = ModelFacade.getDatabase(user, pass, host, port);
		
		return databases;
	}

}
